package com.hi5.util;

import java.util.Collection;

public class Validation {
    public static void state(boolean b, String message) {
        if (!b) {
            throw new RuntimeException(message);
        }
    }

    public static boolean empty(Object o) {
        return o == null;
    }

    public static boolean empty(String s) {
        return s == null || s.isEmpty();
    }

    public static boolean empty(Collection<?> c) {
        return c == null || c.isEmpty();
    }

    public static boolean notEmpty(Object o) {
        return !empty(o);
    }

    public static boolean notEmpty(String s) {
        return !empty(s);
    }

    public static boolean notEmpty(Collection<?> c) {
        return !empty(c);
    }
}
